﻿using Eassets.Data;
using Eassets.Layered.Domain;
using System.Collections.ObjectModel;

namespace Eassets.Service
{
    public class EmployeeService
    {
        private EmployeeData employeeData = new EmployeeData();

        /// <summary>
        /// Inserts employee.
        /// </summary>
        /// <param name="employee"></param>
        public void AddEmployee(Employee employee)
        {
            if (employee != null)
            {
                employeeData.AddEmployee(employee);
            }
        }

        /// <summary>
        /// Updates employee.
        /// </summary>
        /// <param name="employee"></param>
        public void ModifyEmployee(Employee employee)
        {
            if (employee != null)
            {
                employeeData.ModifyEmployee(employee);
            }
        }

        /// <summary>
        /// Delete employee.
        /// </summary>
        /// <param name="employeeId"></param>
        public void DeleteEmployee(long employeeId)
        {
            if (employeeId != 0)
            {
                employeeData.DeleteEmployee(employeeId);
            }
        }

        /// <summary>
        /// GetbyId employee.
        /// </summary>
        /// <param name="employeeId"></param>
        /// <returns></returns>
        public Employee GetByIdEmployee(long employeeId)
        {
            return employeeData.GetByIdEmployee(employeeId);
        }

        /// <summary>
        /// GetAll employee.
        /// </summary>
        /// <returns></returns>
        public Collection<Employee> GetAllEmployee()
        {
            return employeeData.GetAllEmployee();
        }

        public Employee GetEmployeeLoginDetails(string email, string password)
        {
            return employeeData.GetEmployeeLoginDetails(email, password);
        }
    }
}


